package com.heqiang.dao;


import ch.qos.logback.classic.db.names.TableName;
import com.heqiang.constant.Constant;
import com.heqiang.entity.manager.Role;
import com.heqiang.tools.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface RoleDao {


    /**
     *@Description 查询-全部角色数据
     *@Author  zhang heqiang
     *@CreateTime  2020/2/26 17:08
     */
    List<Role> search(Role role);

    @Select("select * from "+Constant.TABLE_NAME.ROLE+" order by weight asc")
    List<Role> findAll();

    @Select("select * from "+Constant.TABLE_NAME.ROLE+" where id = #{id}")
    Role get(String id);

    @Delete("delete from "+Constant.TABLE_NAME.ROLE+" where id = #{id}")
    void del(Long id);

}
